<template>
  <div class="recharge-container">
    <el-tabs v-model="activeName">
      <el-tab-pane label="第三方支付" name="other" class="other">
        <div @click="handleUndevelop">
          <i class="huobo huobo-zhifubao"></i>
          <p>支付宝</p>
        </div>
        <div @click="handleUndevelop">
          <i class="huobo huobo-wechat"></i>
          <p>微信</p>
        </div>
        <div @click="handleUndevelop">
          <i class="huobo huobo-yinlian"></i>
          <p>银联</p>
        </div>
    </el-tab-pane>
      <el-tab-pane label="在线支付" name="online" class="online">
        <div class="main">
          <div class="tips"><i class="el-icon-info"></i>请在上方选择对应的付款方式，推荐使用支付宝或微信付款，审核快，秒到账</div>
          <div class="collection-wrap">
            <div class="header">收款银行卡</div>
            <div>
              <span>银行名称</span>
              <span>{{collection.name}}</span>
            </div>
            <div>
              <span>银行卡号</span>
              <span>{{collection.no}}</span>
            </div>
            <div>
              <span>银行户名</span>
              <span>{{collection.accountName}}</span>
            </div>
            <div>
              <span>开户地</span>
              <span>{{collection.place}}</span>
            </div>
          </div>
          <div class="payment-wrap">
            <el-form v-model="formData" :rules="rules"  label-position="left" label-width="100px">
              <el-form-item label="付款银行">
                <el-select v-model="formData.bank"></el-select>
              </el-form-item>
              <el-form-item label="银行卡号" prop="bankNo">
                <el-input v-model="formData.bankNo" placeholder="请输入正确的银行卡号" />
              </el-form-item>
              <el-form-item label="存款金额">
                <el-autocomplete
                  class="inline-input"
                  v-model="formData.money"
                  :fetch-suggestions="queryMoney"
                  placeholder="请输入内容"
                ></el-autocomplete>
              </el-form-item>
              <el-form-item label="银行卡户名" prop="bankName">
                <el-input v-model="formData.bankName" placeholder="请输入银行卡户名" />
              </el-form-item>
              <el-form-item label="用户账户" prop="accountName">
                <el-input v-model="formData.accountName" placeholder="请输入用户账户" />
              </el-form-item>
              <el-form-item label="存款时间" prop="date">
                <el-date-picker type="datetime" v-model="formData.date" />
              </el-form-item>
            </el-form>
            <el-button type="primary" @click="savePayment">立即存款</el-button>
          </div>
        </div>
        <div class="aside">
          <div class="title">温馨提示</div>
          <p
            v-for="(item, index) in tipsList"
            :key="index"
          >
            {{index + 1}}、{{item}}
          </p>
        </div>
      </el-tab-pane>
    </el-tabs>
  </div>
</template>

<script>
export default {
  name: 'Recharge',
  data() {
    return {
      activeName: 'online',
      collection: {
        name: '中国工商银行',
        no: '61211412515151',
        accountName: '进增额',
        place: '中国朝鲜支行'
      },
      tipsList: [
        '使用担宝博单笔最低存款为￥100元人民币，线上支付单笔最高存款上限为￥50，000人民币，若存款超过￥50，000，请分多次存款；公司入款单笔最高上限为￥1，000，000元人民币',
        '公司入款时效，公司入款可以用网银转账，ATM存款，或者柜台汇款的方式支付，必须指定公司入款账号。跨行转账请您使用跨行快汇，存款到账时间约为三到五分钟，有任何问题随时联系在线客服。',
        '在线存款时效，及时到账。若有延迟，请联系客服。',
        '未开通网银的会员，请亲洽您的银行柜台办理',
        '如有任何问题，请您联系24小时在线客服'
      ],
      formData: {},
      rules: {}
    };
  },
  methods: {
    queryMoney(val, cb) {
      const moneys = [
        { value: '100' },
        { value: '200' },
        { value: '500' },
        { value: '1000' },
        { value: '5000' }
      ];
      cb(moneys);
    },
    savePayment() {},
    handleUndevelop() {
      this.$message({
        type: 'warning',
        message: '暂未开发'
      });
    }
  }
};
</script>

<style lang="less">
  .recharge-container {
    padding-left: 10px;
    .other {
      display: flex;
      margin: 30px auto;
      padding: 20px;
      width: 60%;
      background-color: #fff;
      border-radius: 10px;
      > div {
        display: flex;
        flex: 1;
        flex-direction: column;
        align-items: center;
        padding: 10px 0;
        border-right: 1px solid #ddd;
        border-radius: 6px;
        cursor: pointer;
        &:hover {
          background-color: #b1eaf5;
        }
        &:last-child {
          border: 0;
        }
        .huobo {
          font-size: 50px;
        }
      }
    }
    .online {
      display: flex;
      .main {
        flex: 1;
        .tips {
          margin-bottom: 10px;
          font-size: #666;
          .el-icon-info {
            margin-right: 5px;
            color: #409EFF;
          }
        }
        .collection-wrap {
          margin: 10px 0;
          background-color: #fff;
          > div {
            display: flex;
            height: 40px;
            justify-content: center;
            align-items: center;
            border-bottom: 1px solid #ddd;
            &:last-child {
              border: 0;
            }
            span {
              flex: 1;
              padding-left: 10px;
              &:first-child {
                flex: 0 0 100px;
              }
            }
          }
          .header {
            background-color: #e01010;
            color: #fff;
          }
        }
        .payment-wrap {
          padding: 10px;
          background-color: #fff;
          .el-autocomplete,
          .el-select,
          .el-input {
            width: 100%;
          }
          .el-button {
            margin-left: 100px;
            width: 60%;
          }
        }
      }
      .aside {
        flex: 0 0 300px;
        margin-left: 20px;
        .title {
          padding-bottom: 10px;
          font-size: 18px;
          font-weight: 600;
          color: #333;
        }
        p {
          line-height: 20px;
          margin-bottom: 5px;
          color: #666;
        }
      }
    }
  }
</style>
